Skip to content

shellcheck: improve handling of ShellCheck internal errors#196

Merged
kdudka merged 2 commits intocsutils:mainfrom
kdudka:sc-int-error
Mar 4, 2025
Merged

shellcheck: improve handling of ShellCheck internal errors#196
kdudka merged 2 commits intocsutils:mainfrom
kdudka:sc-int-error

Conversation

@kdudka
Copy link
Member

@kdudka kdudka commented Mar 4, 2025

Rather than failing the whole scan, record them in the scan results.

Reproducer:

csmock -r rhel-7.7.z-x86_64 -f pki-core-10.5.16-7.el7_7.src.rpm -t shellcheck

This commit makes the above scan succeed with the following additional finding included in the scan results:

Error: SHELLCHECK_WARNING:
/usr/sbin/pki-server-nuxwdog: internal error: hGetContents: invalid argument (invalid byte sequence)

@kdudka kdudka requested review from jperezdealgaba and sfowl March 4, 2025 14:53
@kdudka kdudka self-assigned this Mar 4, 2025
kdudka added a commit to kdudka/csmock that referenced this pull request Mar 4, 2025
Rather than failing the whole scan, record them in the scan results.

Reproducer:
```
csmock -r rhel-7.7.z-x86_64 -f pki-core-10.5.16-7.el7_7.src.rpm -t shellcheck
```

This commit makes the above scan succeed with the following additional
finding included in the scan results:
```
Error: SHELLCHECK_WARNING:
/usr/sbin/pki-server-nuxwdog: internal error: hGetContents: invalid argument (invalid byte sequence)
```

Closes: csutils#196
@jperezdealgaba
Copy link
Collaborator

I have not tested the validness of the introduced Regexp but the new changes looks good to me

lzaoral and others added 2 commits March 4, 2025 16:18
Rather than failing the whole scan, record them in the scan results.

Reproducer:
```
csmock -r rhel-7.7.z-x86_64 -f pki-core-10.5.16-7.el7_7.src.rpm -t shellcheck
```

This commit makes the above scan succeed with the following additional
finding included in the scan results:
```
Error: SHELLCHECK_WARNING:
/usr/sbin/pki-server-nuxwdog: internal error: hGetContents: invalid argument (invalid byte sequence)
```

Closes: csutils#196
@kdudka
Copy link
Member Author

kdudka commented Mar 4, 2025

@jperezdealgaba Thanks for review! The Testing Farm failures on Fedora Rawhide seem like infrastructure issues:

[2025-03-04 15:18:01] [E] [test-schedule-runner] Exception raised: Guest couldn't be provisioned: Artemis resource ended in 'error' state

@kdudka kdudka merged commit 083f124 into csutils:main Mar 4, 2025
38 of 40 checks passed
@kdudka kdudka deleted the sc-int-error branch March 4, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants